<?
session_start();

require_once('config.php');

if (count($_POST) > 0)
{
	if (($_POST['username']=="admin") && ($_POST['userpassword'] == DFTPWD))
	{		
		$_SESSION['username'] = $_POST['username'];
		Header("location: admin.php");
		exit();
	}
	else
	{
		$errmsg = "Wrong User Name or Password!";
	}
}


?>
<html>
<head>
<title>Admin Sign In</title>
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<form action="<?= $_SERVER['PHP_SELF'] ?>" method="post">
<table border="0">
  <tr>
    <td height="29" colspan="3"  align="center"><h3>Admin Sign In</h3></td>
  </tr>
  
  <tr>
    <td>Name</td>
    <td><input type="text" name = "username" size="20"></td>
  </tr>
  <tr>
  	<td>Password</td>
    <td><input size="20" type ="password" name = "userpassword"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td align="right"><input name="submit" type="submit" value = "Sign In >>>" ></td>
  </tr>
</table>
</form>
</body>
</html>